﻿
@{
    ViewBag.Title = "Index";
}

<h2>条形码生成</h2>

<form class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-2 col-lg-1">条码内容</label>
        <div class="col-sm-10 col-lg-11">
            <textarea class="form-control" id="code" placeholder="条码内容" rows="3"></textarea>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10 col-lg-offset-1 col-lg-11">
            <button type="button" id="" onclick="CreateBarCode()" class="btn btn-primary">生成条码</button>
        </div>
    </div>
</form>
<br />
<div class="panel panel-default">
    <div class="panel-body">
        请输入条码内容后点击生成条码按钮
        
    </div>
</div>

<script>
    function CreateBarCode() {
        var code = $("#code").val();
        if (code) {
            $(".panel-body").html("<img id='imgBarCode' style='width:100%;' />");
            $("#imgBarCode").attr("src", "/Files/BarCode/CreateBarCode?code=" + code);
        }
    }
</script>